﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>请求串的生成</title>
<script type="text/javascript" src="libs/js/jquery.js"></script>
</head>
<body>
<form action="" method="post">
<table cellspacing="5">
  <tbody>
  <tr>
    <td align="right">接口方法：</td>
    <td><select id="func" name="func">
          <option value="trace">trace</option>
        </select>
    </td>
  </tr>
  <tr>
    <td align="right">合作方：</td>
    <td><input name="partner" type="text" class="date" id="partner" value="ceshi"/> <font style="font-size:12px;color:red">* 必填</font></td>
  </tr>
  <tr>
    <td align="right">密码：</td>
    <td><input name="pass" type="text" class="date" id="pass" value="liang12345"/> <font style="font-size:12px;color:red">* 必填</font></td>
  </tr>
 <tr>
   <td align="right">请求单号：</td>
   <td style="padding-top: 3px; padding-bottom: 3px;"><input type="text" id="content" name="content" value="123456789" > <font style="font-size:12px;color:red">* 必填</font></td>
</tr>
<tr>
  <td>&nbsp;</td>
  <td height="50" valign="top"><input type="button" value="生成请求串及获得请求结果" onclick="BaseCountCode()" /></td>
</tr>
<tr>
    <td align="right">请求的内容编码串：</td>
    <td><input type="text" id="contentM" name="contentM" size="50"></td>
</tr>
<tr>
    <td align="right">请求的校验加密串：</td>
    <td><input name="verify" type="text" id="verify" size="50" /></td>
</tr>
<tr>
    <td align="right">请求的返回结果：</td>
    <td><textarea  style="width: 700px; height: 150px;" id="result" name="result"></textarea></td>
</tr>
  </tbody>
</table>
</form>
<script type="text/javascript">
function BaseCountCode() {
	var func = $("#func").val();
	var content = $("#content").val();
	var partner = $("#partner").val();
	var pass = $("#pass").val();
	$.post("service.php",
	{"func": func, "partner": partner, "pass": pass, "content": content },
	function (result) {
	 if(result.status='OK'){
		$("#contentM").val(result.content);
		$("#verify").val(result.verify);
		$("#result").val(result.result);
	 }
	}, "json");
}
</script>
</body>
</html>